home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_13900.txt < prev    next >
Text File  |  1991-02-27  |  683b  |  22 lines

  1. -- card: 13900 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10.     printf("My age is %d\n",age);
  11.     printf("My weight is %d\n",weight);
  12.  
  13. The Person::print() method outputs the values of the instance variables.
  14.  
  15. As mentioned earlier, printf() accepts a character string as its first argument, followed by an appropriate list of arguments.  The characters '%d' contained in the string specify that an integer value is to be printed in this location, in this case the value represented by the variable age or the variable weight.
  16.  
  17.  
  18.  
  19.  
  20. -- part contents for background part 7
  21. ----- text -----
  22. 32